/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package biofilter.records.NimbleGen;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import biofilter.sources.RecordsFile;
import biofilter.exceptions.InvalidRecordException;

/**
 *
 * @author Daniel Quest
 * @date   Jan 8 2009
 */
public class NimbleGenNDFRecordTest {

    RecordsFile rf = null;
    NimbleGenNDFRecord instance = null;
    public NimbleGenNDFRecordTest() {

        try {
            String seqFile = "test/testdata/NimbleGen/example_090803_Ctherm_SB_EXP.ndf";
            rf = new RecordsFile(seqFile, "biofilter.records.NimbleGen.NimbleGenNDFRecord");
            rf.setHeaderKeyword("PROBE_DESIGN_ID");

            if(rf.eof() == false) {
                if(rf == null) System.out.println("rf is null");
                rf.getRecord();  //Kill the header
                instance = (NimbleGenNDFRecord) rf.getRecord();
                //instance.parse();
            }
            else {
                System.out.println("eof returned true");
            }
        } catch (InvalidRecordException ex) {
            System.err.println("error");
        }

    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of get method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGet() {
        System.out.println("get");
        String expResult = "10425_0001_0001	NGS_CONTROLS	crosshhybe	bright	CROSSHYBE	TAGCGTTGCTTAGGCGTACGCAGTCTGATGCGTCGTTAGCATCGGCAANNNNNNNNNN	0	241440130	241440130	1	1	control:crosshybe	XENOTRACK48P01	1	10425	1	1";
        assertEquals(expResult, instance.get());
    }

    /**
     * Test of getColNum method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetColNum() {
        System.out.println("getColNum");
        int expResult = 1;
        int result = instance.getColNum();
        assertEquals(expResult, result);
    }


    /**
     * Test of getContainer method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetContainer() {
        System.out.println("getContainer");
        String expResult = "NGS_CONTROLS";
        String result = instance.getContainer();
        assertEquals(expResult, result);
    }
    /**
     * Test of getDesignID method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetDesignID() {
        System.out.println("getDesignID");
        int expResult = 10425;
        int result = instance.getDesignID();
        assertEquals(expResult, result);
    }


    /**
     * Test of getDesignNote method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetDesignNote() {
        System.out.println("getDesignNote");
        String expResult = "crosshhybe";
        String result = instance.getDesignNote();
        assertEquals(expResult, result);
    }

    /**
     * Test of getFeatureID method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetFeatureID() {
        System.out.println("getFeatureID");
        int expResult = 241440130;
        int result = instance.getFeatureID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getMatchIndex method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetMatchIndex() {
        System.out.println("getMatchIndex");
        int expResult = 241440130;
        int result = instance.getMatchIndex();
        assertEquals(expResult, result);
    }

    /**
     * Test of getMismatch method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetMismatch() {
        System.out.println("getMismatch");
        int expResult = 0;
        int result = instance.getMismatch();
        assertEquals(expResult, result);
    }

    /**
     * Test of getPosition method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetPosition() {
        System.out.println("getPosition");
        int expResult = 1;
        int result = instance.getPosition();
        assertEquals(expResult, result);
    }

    /**
     * Test of getProbeClass method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetProbeClass() {
        System.out.println("getProbeClass");
        String expResult = "control:crosshybe";
        String result = instance.getProbeClass();
        assertEquals(expResult, result);
    }

    /**
     * Test of getProbeID method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetProbeID() {
        System.out.println("getProbeID");
        String expResult = "XENOTRACK48P01";
        String result = instance.getProbeID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getProbeSequence method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetProbeSequence() {
        System.out.println("getProbeSequence");
        String expResult = "TAGCGTTGCTTAGGCGTACGCAGTCTGATGCGTCGTTAGCATCGGCAANNNNNNNNNN";
        String result = instance.getProbeSequence();
        assertEquals(expResult, result);
    }

    /**
     * Test of getProbe_Design_ID method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetProbe_Design_ID() {
        System.out.println("getProbe_Design_ID");
        String expResult = "10425_0001_0001";
        String result = instance.getProbe_Design_ID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getRowNum method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetRowNum() {
        System.out.println("getRowNum");
        int expResult = 1;
        int result = instance.getRowNum();
        assertEquals(expResult, result);
    }

    /**
     * Test of getSelectionCriteria method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetSelectionCriteria() {
        System.out.println("getSelectionCriteria");
        String expResult = "bright";
        String result = instance.getSelectionCriteria();
        assertEquals(expResult, result);
    }

    /**
     * Test of getSeqID method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetSeqID() {
        System.out.println("getSeqID");
        String expResult = "CROSSHYBE";
        String result = instance.getSeqID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getX method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetX() {
        System.out.println("getX");
        int expResult = 1;
        int result = instance.getX();
        assertEquals(expResult, result);
    }

    /**
     * Test of getY method, of class NimbleGenNDFRecord.
     */
    @Test
    public void testGetY() {
        System.out.println("getY");
        int expResult = 1;
        int result = instance.getY();
        assertEquals(expResult, result);
    }

}